/*
 * CompressionNone
 * 
 * Copyright (c) 2002, 2003 Marco Schmidt.
 * All rights reserved.
 * 
 * translated to C# by asida
 * Copyright (c), Adam Sida, asida@centrum.cz
 */
using System;

namespace Petra.Gis.ImagingServices.Tiff
{

  ///<summary>
  ///TIFF decoder for uncompressed bands
  ///</summary>>
  public class CompressionNone : Compression
  {


    public CompressionNone()
      : base() { }



    public CompressionNone(BlockBitmapSource currImage)
      : base(){ }



    //public override Compression CreateCompression(TiffBitmapPage currImage)
    //{
    //  return new CompressionNone(currImage);
    
    //}



    public override byte[] DecompressBlock(BitmapBlock block, byte[] comprData, int srcBitsPerSample)
    {

      return alignDataToStride(block.PaddingWidth, block.PaddingHeight, _uncompressedDataBuff, srcBitsPerSample);

      //if (BitmapBlock.GetStrideLenght(block.PaddingWidth, srcBitsPerSample) != (block.PaddingWidth * srcBitsPerSample))
      //  return alignDataToStride(block.PaddingWidth, block.PaddingHeight, comprData, srcBitsPerSample);
      //else
      //  return comprData;
    }



    public override CompressionType[] CompressionTypes
    {
      get { return new CompressionType[] { CompressionType.NONE }; }
    }
  }
}
